package com.mapper;

import com.entity.UserTable;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @description:
 * @author: GuoTong
 * @createTime: 2021-06-23 10:23
 * @since JDK 1.8 OR 11
 **/
@Mapper
public interface UserMapper {

    /**
     * Description: 无条件查询
     */
    List<UserTable> getUsers();

    /**
     * Description:条件查询
     */
    UserTable getUserById(@Param("userId") int userId);

    /**
     * Description:分页查询
     */
    List<UserTable> getUserByLimit(@Param("startIndex") int startIndex, @Param("everyPageSize") int everyPageSize);


    /**
     * Description: 新增 返回的结果是影响行数
     */
    int insertInToUserTable(UserTable tableObj);

    /**
     * Description: 修改
     */
    int updateUserTableById(UserTable tableObj);

    /**
     * Description:删除
     */
    int deleteusertablebyid(@Param("id") int id);

    UserTable selectByUserNameAndPassword(@Param("username") String username, @Param("password") String password);

    UserTable selectByEmail(@Param("userEmail") String userEmail);
}

